//
//  CXHelpHeader.swift
//  CXSwiftDemo
//
//  Created by 潮汐 on 2023/11/30.
//
//项目里各种全局宏定义

import UIKit//这样可以全局使用这个类里的宏定义

// MARK: - 获取屏幕高宽
let SCREEN_WIDTH = UIScreen.main.bounds.size.width
let SCREEN_HEIGHT = UIScreen.main.bounds.size.height

/// 适配iPhone X 状态栏高度 20或者44
#if __IPHONE_13_0
let MC_StatusBarHeight = UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.size.height
#else
let MC_StatusBarHeight = UIApplication.shared.statusBarFrame.size.height
#endif

/// 导航栏+状态栏高度 88或者64
let MC_NavHeight = MC_StatusBarHeight + 44.0

/// 适配iPhone X Tabbar高度 83或者49
let MC_TabbarHeight: Double = UIApplication.shared.statusBarFrame.size.height > 20 ? 83:49
/// 适配iPhone X Tabbar距离底部的距离
let MC_TabbarSafeBottomMargin = UIApplication.shared.statusBarFrame.size.height > 20 ? 34:0


///判断是否是iPhone X
let iPhoneX = ((MC_StatusBarHeight != 20) ? true : false)




// MARK: - 颜色
var RGBA:(NSInteger, NSInteger, NSInteger, CGFloat) -> UIColor = { (r,g,b,a) in
    return UIColor(red: CGFloat(r)/255.0, green: CGFloat(g)/255.0, blue: CGFloat(b)/255.0, alpha: a)
}

var RGB:(NSInteger, NSInteger, NSInteger) -> UIColor = { (r,g,b) in
    return UIColor(red: CGFloat(r)/255.0, green: CGFloat(g)/255.0, blue: CGFloat(b)/255.0, alpha: 1.0)
}

//16进制颜色转换
var HexRGB:(NSInteger) -> UIColor = { hex in
    return UIColor(red: ((CGFloat)((hex & 0xFF0000) >> 16)) / 255.0, green: ((CGFloat)((hex & 0xFF00) >> 8)) / 255.0, blue: ((CGFloat)((hex & 0xFF))) / 255.0, alpha: 1.0)
}
//16进制颜色转换（带透明度）
var HexRGBAlpha:(NSInteger, CGFloat) -> UIColor = { (hex, alpha) in
    return UIColor(red: ((CGFloat)((hex & 0xFF0000) >> 16)) / 255.0, green: ((CGFloat)((hex & 0xFF00) >> 8)) / 255.0, blue: ((CGFloat)((hex & 0xFF))) / 255.0, alpha: alpha)
}

//白色：导航背景色
let kMainColor_NavBG = HexRGB(0xFFFFFF)






